﻿using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;
using System.Windows.Input;
using DeepEarth.Core.Utilities;

namespace DeepEarth.Toolkit.Geometry
{
    public class Balloon : Control
    {
        //public static readonly DependencyProperty FillProperty = DependencyProperty.Register("Fill",
        //    typeof(Brush), typeof(Balloon), new PropertyMetadata(new SolidColorBrush(Colors.White)));

        //public Brush Fill
        //{
        //    get { return (Brush)GetValue(FillProperty); }
        //    set { SetValue(FillProperty, value); }
        //}


        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(Balloon), null);

        public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }        

        public static readonly DependencyProperty CloseCommandProperty =
            DependencyProperty.Register("CloseCommand", typeof(ICommand), typeof(Balloon), null);

        public ICommand CloseCommand
        {
            get { return (ICommand)GetValue(CloseCommandProperty); }
            set { SetValue(CloseCommandProperty, value); }
        }

        public static readonly DependencyProperty TranslateXProperty =
            DependencyProperty.Register("TranslateX", typeof(double), typeof(Balloon), null);

        public double TranslateX
        {
            get { return (double)GetValue(TranslateXProperty); }
            set { SetValue(TranslateXProperty, value); }
        }

        public static readonly DependencyProperty TranslateYProperty =
            DependencyProperty.Register("TranslateY", typeof(double), typeof(Balloon), null);

        public double TranslateY
        {
            get { return (double)GetValue(TranslateYProperty); }
            set { SetValue(TranslateYProperty, value); }
        }

        public Balloon()
        {
            //this.DataContext = this;
            CloseCommand = new LambdaCommand(() => this.Visibility = Visibility.Collapsed);

            this.DefaultStyleKey = typeof(Balloon);
        }
    }
}
